const app = getApp()
Component({
    options: {
        multipleSlots: true
    },
    properties: {
        title:{
            type: String,
            value: ''
        },
        navImg:{
            type: String,
            value: ''
        },
        bgColor:{
            type: String,
            value: ''
        },
        isBack: {
            type: Boolean,
            value: false
        },
        backUrl: {
            type: String,
            value: ''
        },
    },
    data: {},
    ready() {
        let {
            statusBarHeight,
            navBarHeight
        } = app.globalData;
        this.setData({
            statusBarHeight,
            navBarHeight
        })
    },
    methods: {
        back() {
            if(this.data.backUrl === '/pages/index/index'){
                wx.switchTab({
                    url: this.data.backUrl,
                })
            }else{
                wx.navigateBack({
                    delta:1
                })
            }
        }
    }
})